def solution(numbers):
    # 初始状态：和为0（偶数）的方案数为1，奇数方案数为0
    even = 1
    odd = 0

    for group in numbers:
        # 将数字组转换为字符串以便迭代每一位
        group_str = str(group)
        # 统计当前组中奇数和偶数的数量
        odd_count = 0
        even_count = 0
        for c in group_str:
            num = int(c)
            if num % 2 == 1:
                odd_count += 1
            else:
                even_count += 1

        # 更新状态
        new_even = even * even_count + odd * odd_count
        new_odd = even * odd_count + odd * even_count
        even, odd = new_even, new_odd

    return even


if __name__ == "__main__":
    print(solution([123, 456, 789]) == 14)
    print(solution([123456789]) == 4)
    print(solution([14329, 7568]) == 10)